<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Add Item</title>
<script type="text/javascript" src="<c:url value="/js/jquery.js"/>"></script>
<script type="text/javascript" src="<c:url value="/js/getbooksdata.js"/>"></script>
</head>
<body>
<form:form commandName="item">
<table>
<tr>
<td>ISBN:</td><td><form:input path="isbn"/><input type="button" value="Get Data" onclick="getDataFromGoogle()"/></td>
</tr>
<tr>
<td>Type:</td><td><form:select path="type">
<form:options items="${item.type}"/>
</form:select></td>
</tr>
<tr>
<td>Title:</td><td><form:input path="title" size="60"/></td>
</tr>
<tr>
<td>Author:</td><td><form:input path="author" size="60"/></td>
</tr>
<tr>
<td>Edition:</td><td><form:input path="edition" size="60"/></td>
</tr>
<tr>
<td>No of Pages:</td><td><form:input path="noOfPages" size="60"/></td>
</tr>
<tr>
<td>Publisher:</td><td><form:input path="publisher" size="60"/></td>
</tr>
<tr>
<td>Published Date:</td><td><form:input path="publicationDate" size="60"/></td>
</tr>
<tr>
<td>Categories:</td><td><form:select path="categories" multiple="multiple">
<form:options items="${allCategories}" itemValue="id" itemLabel="name"/>
</form:select></td>
</tr>
<tr>
<td>Language:</td><td><form:select path="language">
<form:options items="${item.language}"/>
</form:select></td>
</tr>
<tr>
<td>Synopsis/description:</td><td><form:textarea rows="5" cols="40" path="synopsis"/></td>
</tr>
<tr>
<td style="text-align:center" colspan="2">
<input type="submit" value="Add Item"/>
</td>
</tr>
</table>
</form:form>
</body>
</html>